package com.tanqidi.arcgisandroid

import android.app.Application
import com.tanqidi.arcgisandroid.base.utils.NeverCrashUtils
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class App : Application() {

    companion object {
        @JvmField
        var app: App? = null
    }

    override fun onCreate() {
        super.onCreate()
        app = this

        globalCrash()
    }

    private fun globalCrash(){
        //全局异常捕获
        NeverCrashUtils.getInstance()
            .setDebugMode(BuildConfig.DEBUG)
            .setMainCrashHandler { t, e ->
                //配置项：自定义错误上报自定义错误
            }.setUncaughtCrashHandler { t, e ->
                //配置项：自定义错误上报自定义错误
            }
            .register(this)
    }
}